﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<FindPharmacies.Model.Pharmacy>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Edit
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Edit</h2>

    <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>
        
        <fieldset>
            <legend>Fields</legend>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.PharmacyID) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Name) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Name) %>
                <%: Html.ValidationMessageFor(model => model.Name) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Street) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Street) %>
                <%: Html.ValidationMessageFor(model => model.Street) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.No) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.No) %>
                <%: Html.ValidationMessageFor(model => model.No) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Zip) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Zip) %>
                <%: Html.ValidationMessageFor(model => model.Zip) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.City) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.City) %>
                <%: Html.ValidationMessageFor(model => model.City) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.State) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.State) %>
                <%: Html.ValidationMessageFor(model => model.State) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.OpeningHours) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.OpeningHours) %>
                <%: Html.ValidationMessageFor(model => model.OpeningHours) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.EmergencyService) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.EmergencyService) %>
                <%: Html.ValidationMessageFor(model => model.EmergencyService) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.EmergencyTimes) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.EmergencyTimes) %>
                <%: Html.ValidationMessageFor(model => model.EmergencyTimes) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Phone) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Phone) %>
                <%: Html.ValidationMessageFor(model => model.Phone) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Email) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Email) %>
                <%: Html.ValidationMessageFor(model => model.Email) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Website) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Website) %>
                <%: Html.ValidationMessageFor(model => model.Website) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Latitude) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Latitude, String.Format("{0:F6}", Model.Latitude)) %>
                <%: Html.ValidationMessageFor(model => model.Latitude) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Longitude) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Longitude, String.Format("{0:F6}", Model.Longitude)) %>
                <%: Html.ValidationMessageFor(model => model.Longitude) %>
            </div>
            
            <p>
                <input type="submit" value="Save"  />
            </p>
        </fieldset>

    <% } %>
    <% using (Html.BeginForm("delete", "pharmacy")) {%>
        <%=Html.Hidden("id", Model.PharmacyID) %>
        <input type="submit" value="Delete" />
    <% } %>
    <div>
        <%: Html.ActionLink("Back to List", "Admin") %>
    </div>

</asp:Content>

